package com.jinsilu.freight.ui.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jinsilu.freight.R;
import com.jinsilu.freight.http.response.SourceHallBean;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.List;

public class SourceHallAdapter extends BaseQuickAdapter<SourceHallBean, BaseViewHolder> {

    public SourceHallAdapter(@Nullable List<SourceHallBean> data) {
        super(R.layout.item_new_source_hall, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, SourceHallBean s) {
        holder.setText(R.id.partner_name, s.getPartnerName())
                .setText(R.id.line_address, s.getLineName())
                .setText(R.id.product_name, s.getGoodsName())
                .setText(R.id.product_price, String.format("%s元/吨", s.getPurchasePrice()))
//                .setText(R.id.create_time, String.format("%s", MyTimeUtils.convertTime(s.getCreateTime(), TimeZone.getTimeZone("GMT+8"))))
                .setText(R.id.create_time, String.format("%s", s.getCreateTime()))
                .setText(R.id.remark, String.format("%s", TextUtils.isEmpty(s.getRemarks()) ? "无" :
                        TextUtils.isEmpty(s.getRemarks().trim()) ? "无" : s.getRemarks()))
                .setText(R.id.transport_price, String.format("运价：%s元/吨", s.getSettlePrice()));
//                .setText(R.id.item_source_order_number, String.format("订单号：%s", s.getToNumber()))
//                .setText(R.id.item_source_goods_name, s.getGoodsName())
//                .setText(R.id.item_source_money, String.format("%s元/吨", s.getWOrderPrice()))
//                .setText(R.id.item_source_order_date, String.format("创建时间：%s", switchCreateTime(s.getToCreatetime())))
//                .setText(R.id.item_source_order_remark, String.format("备注：%s", TextUtils.isEmpty(s.getMmo()) ? "无" :
//                        TextUtils.isEmpty(s.getMmo().trim()) ? "无" : s.getMmo()));
    }
}
